package com.certification.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.certification.entity.Certification;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.Map;

/**
 * @author copa
 * @createDate 2022-03-28 23:55
 * @function
 */
@Repository
public interface CertificationMapper extends BaseMapper<Certification> {

    @Select("SELECT cert_stage certStage, cert_status certStatus " +
            "FROM certification  " +
            "WHERE principal_id = #{userId}  " +
            "ORDER BY id DESC  " +
            "LIMIT 1")
    Map<String, Object> selectCertResult(@Param("userId") Integer userId);
}
